//
//  HWOpenVipLockView.swift
//  HWanGame
//
//  Created by 王昌健 on 2021/12/9.
//  Copyright © 2021 94Wan. All rights reserved.
//

import UIKit

class HWOpenVipLockView: UIView {
    var lockImageView:UIImageView!
    var titleLabel:UILabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initUI()
        
        initFrame()
        
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

extension HWOpenVipLockView {
    private func initUI() -> Void {
        
        backgroundColor = .colorWithHexString(hexString: "#D0D0D0")
        layer.cornerRadius = 2
        
        
        lockImageView = UIImageView()
        lockImageView.image = UIImage(named: "lockImage")
        addSubview(lockImageView)
        
        titleLabel = HWLabel.createLabel(title: "", color: "#9A9898", font: 10)
        addSubview(titleLabel)
    }
    
    private func initFrame() -> Void {
        lockImageView.snp.makeConstraints { make in
            make.left.equalTo(6)
            make.top.equalTo(2)
            make.bottom.equalTo(-2)
            make.width.equalTo(7)
            make.height.equalTo(10)
        }
        
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(lockImageView.snp.right).offset(5)
            make.right.equalTo(-7)
            make.centerY.equalToSuperview()
        }
    }
}
